import { PlayerDialog } from "./PlayerDialog";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { Language } from "../../../../../extend/language/Language";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { SGuildFlameInfo } from "../../../../../Message/Game/SGuildFlameInfo";
//class GuildFlameCount
    
    export  class GuildFlameCount extends PlayerDialog
    {
        constructor()
        {
            super();
            mouseEnabled = false;
            mouseChildren = false;
            this.initUI();
            return;
        }

        /* internal  */initUI(): void
        {
            this._countTxt = new Object /* flash.text.TextField */();
            this._countTxt.selectable = false;
            this._countTxt.multiline = true;
            this._countTxt.wordWrap = true;
            this._countTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            var loc1=new GTextFormat(FontUtil.songtiName, 12, 48895);
            loc1.leading = 8;
            this._countTxt.defaultTextFormat = loc1;
            this._countTxt.filters = [FilterConst.nameGlowFilter];
            this._countTxt.x = 0;
            this._countTxt.y = 0;
            this._countTxt.width = 120;
            this._countTxt.height = 40;
            addChild(this._countTxt);
            this.initData();
            return;
        }

        public initData(): void
        {
            var loc1=Language.getString(20517) + "：";
            loc1 = loc1 + HTMLUtil.addColor("0", GlobalStyle.color1);
            loc1 = loc1 + "<br>";
            loc1 = loc1 + (Language.getString(20518) + "：");
            loc1 = loc1 + HTMLUtil.addColor("0%", GlobalStyle.color1);
            this._countTxt.htmlText = HTMLUtil.addColor(loc1, GlobalStyle.color2);
            return;
        }

        public /* override */ updateData(arg1: Array<any>): void
        {
            this._flameInfo = arg1[0];
            var loc1=Language.getString(20517) + "：";
            loc1 = loc1 + HTMLUtil.addColor(this._flameInfo.firewood + "", GlobalStyle.color1);
            loc1 = loc1 + "<br>";
            loc1 = loc1 + (Language.getString(20518) + "：");
            loc1 = loc1 + HTMLUtil.addColor(this._flameInfo.addExpRate + "%", GlobalStyle.color1);
            this._countTxt.htmlText = HTMLUtil.addColor(loc1, GlobalStyle.color2);
            return;
        }

        public /* override */ dispose(): void
        {
            super.dispose();
            this._countTxt.text = "";
            this._flameInfo = null;
            return;
        }

        public /* override */ get height(): number
        {
            return 40;
        }

        /* internal */ /* var */_countTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_flameInfo: SGuildFlameInfo;
    }
